package org.example.controller;

import org.example.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;
import java.util.List;


@Controller
public class UseController {
    @RequestMapping("each")
    public String th(Model model){
        List<Student> students= Arrays.asList(
                new Student("20240001","愚公","123"),
                new Student("20240002","夸父","456"),
                new Student("20240003","精卫","789")
        );
        model.addAttribute("studentList",students) ;
        return "mythymeleaf.html";
    }

}
